//
//  AuctionGoodsNameView.m
//  phmall
//
//  Created by admin on 2017/12/4.
//  Copyright © 2017年 admin. All rights reserved.
//

#import "AuctionGoodsNameView.h"

@implementation AuctionGoodsNameView

-(instancetype)init{
    if (self=[super init]) {
        self.backgroundColor=[UIColor whiteColor];
        
        self.name=[[UILabel alloc] init];
        self.name.text=@"Clinique 保湿纯原浆水果多色保湿润唇膏(新款)热卖";
        self.name.font=[UIFont systemFontOfSize:15];
        self.name.numberOfLines=0;
        [self addSubview:self.name];
        
        self.priceLabel=[[UILabel alloc] init];
        self.priceLabel.text=[NSString stringWithFormat:@"%@:",Localized(@"当前出价")];
        self.priceLabel.textColor=[UIColor colorWithHexString:@"#adadad"];
        self.priceLabel.font=[UIFont systemFontOfSize:13];
        [self addSubview:self.priceLabel];
        
        self.price=[[UILabel alloc] init];
        self.price.text=@"₱6666.00";
        self.price.textColor=[UIColor orangeColor];
        self.price.font=[UIFont systemFontOfSize:20];
        [self addSubview:self.price];
        
        self.timeLabel=[[UILabel alloc] init];
        self.timeLabel.text=@"剩余时间";
        self.timeLabel.textAlignment=NSTextAlignmentCenter;
        self.timeLabel.textColor=[UIColor colorWithHexString:@"#adadad"];
        self.timeLabel.font=[UIFont systemFontOfSize:13];
        [self addSubview:self.timeLabel];
        
        self.time=[[UILabel alloc] init];
        self.time.text=@"100天06小时00分33秒";
        self.time.textAlignment=NSTextAlignmentCenter;
        self.time.textColor=[UIColor colorWithHexString:@"#adadad"];
        self.time.font=[UIFont systemFontOfSize:13];
        [self addSubview:self.time];
        
        self.depositLabel=[[UILabel alloc] init];
        self.depositLabel.text=@"保证金";
        self.depositLabel.textAlignment=NSTextAlignmentCenter;
        self.depositLabel.textColor=[UIColor colorWithHexString:@"#adadad"];
        self.depositLabel.font=[UIFont systemFontOfSize:13];
        [self addSubview:self.depositLabel];
        
        self.deposit=[[UILabel alloc] init];
        self.deposit.text=@"₱6666.00";
        self.deposit.textAlignment=NSTextAlignmentCenter;
        self.deposit.textColor=[UIColor colorWithHexString:@"#adadad"];
        self.deposit.font=[UIFont systemFontOfSize:13];
        [self addSubview:self.deposit];
        
        self.rangeLabel=[[UILabel alloc] init];
        self.rangeLabel.text=@"起价幅度";
        self.rangeLabel.textAlignment=NSTextAlignmentCenter;
        self.rangeLabel.textColor=[UIColor colorWithHexString:@"#adadad"];
        self.rangeLabel.font=[UIFont systemFontOfSize:13];
        [self addSubview:self.rangeLabel];
        
        self.range=[[UILabel alloc] init];
        self.range.text=@"₱6666.00";
        self.range.textAlignment=NSTextAlignmentCenter;
        self.range.textColor=[UIColor colorWithHexString:@"#adadad"];
        self.range.font=[UIFont systemFontOfSize:13];
        [self addSubview:self.range];
        
        self.startingLabel=[[UILabel alloc] init];
        self.startingLabel.text=@"起拍价";
        self.startingLabel.textAlignment=NSTextAlignmentCenter;
        self.startingLabel.textColor=[UIColor colorWithHexString:@"#adadad"];
        self.startingLabel.font=[UIFont systemFontOfSize:13];
        [self addSubview:self.startingLabel];
        
        self.starting=[[UILabel alloc] init];
        self.starting.text=@"₱6666.00";
        self.starting.textAlignment=NSTextAlignmentCenter;
        self.starting.textColor=[UIColor colorWithHexString:@"#adadad"];
        self.starting.font=[UIFont systemFontOfSize:13];
        [self addSubview:self.starting];
        
        self.cappingLabel=[[UILabel alloc] init];
        self.cappingLabel.text=@"封顶价";
        self.cappingLabel.textAlignment=NSTextAlignmentCenter;
        self.cappingLabel.textColor=[UIColor colorWithHexString:@"#adadad"];
        self.cappingLabel.font=[UIFont systemFontOfSize:13];
        [self addSubview:self.cappingLabel];
        
        self.capping=[[UILabel alloc] init];
        self.capping.text=@"₱6666.00";
        self.capping.textAlignment=NSTextAlignmentCenter;
        self.capping.textColor=[UIColor colorWithHexString:@"#adadad"];
        self.capping.font=[UIFont systemFontOfSize:13];
        [self addSubview:self.capping];
    }
    return self;
}
-(void)layoutSubviews{
    [super layoutSubviews];
    CGSize superSize = self.frame.size;
    
    if (CGSizeEqualToSize(superSize, CGSizeZero)) {
        return;
    }
    
    [self.name mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.offset(10);
        make.left.offset(10);
        make.right.offset(-10);
    }];
    
    [self.priceLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.name.mas_bottom).offset(10);
        make.left.offset(10);
    }];
    [self.price mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.priceLabel);
        make.left.equalTo(self.priceLabel.mas_right).offset(10);
    }];
    
    [self.timeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.price.mas_bottom).offset(10);
        make.left.offset(10);
    }];
    [self.time mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.timeLabel);
        make.left.equalTo(self.timeLabel.mas_right).offset(10);
    }];
    
    [self.depositLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.time.mas_bottom).offset(10);
        make.left.offset(10);
    }];
    [self.deposit mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.depositLabel);
        make.left.equalTo(self.depositLabel.mas_right).offset(10);
    }];
    
    [self.startingLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.depositLabel.mas_bottom).offset(10);
        make.left.offset(10);
    }];
    [self.starting mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.startingLabel);
        make.left.equalTo(self.startingLabel.mas_right).offset(10);
    }];
    
    [self.rangeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.time.mas_bottom).offset(10);
        make.left.equalTo(self.mas_centerX).offset(10);
    }];
    [self.range mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.rangeLabel);
        make.left.equalTo(self.rangeLabel.mas_right).offset(10);
    }];
    
    [self.cappingLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.depositLabel.mas_bottom).offset(10);
        make.left.equalTo(self.mas_centerX).offset(10);
    }];
    [self.capping mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.cappingLabel);
        make.left.equalTo(self.cappingLabel.mas_right).offset(10);
    }];
}


@end
